package com.easy.modules.sysmgr.web.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.easy.common.util.Const;
import com.easy.common.web.page.DataGrid;
import com.easy.common.web.page.Msg;
import com.easy.modules.sysmgr.service.ScheduleServiceI;
import com.easy.modules.sysmgr.web.form.ScheduleForm;

@Controller
@RequestMapping("/sysmgr/schedule")
public class ScheduleAction {

	@Autowired
	private ScheduleServiceI scheduleService ;
	
	@RequestMapping("/doNotNeedAuth_schedule_main.do")
	public String schedule_main(){
		return  Const.PERSON + "schedule" ;
	}
	
	@RequestMapping("/doNotNeedAuth_get.do")
	@ResponseBody
	public ScheduleForm get(ScheduleForm form){
		return this.scheduleService.get(form) ;
	}
	
	@RequestMapping("/doNotNeedAuth_add.do")
	@ResponseBody
	synchronized public Msg add(ScheduleForm form){
		return this.scheduleService.save(form) ;
	}
	
	@RequestMapping("/doNotNeedAuth_edit.do")
	@ResponseBody
	public Msg edit(ScheduleForm form){
		return this.scheduleService.edit(form) ;
	}
	
	@RequestMapping("/doNotNeedAuth_delete.do")
	@ResponseBody
	public Msg delete(ScheduleForm form){
		return this.scheduleService.delete(form) ;
	}
	
	@RequestMapping("/doNotNeedAuth_datagrid.do")
	@ResponseBody
	public DataGrid datagrid(ScheduleForm form){
		return this.scheduleService.datagrid(form) ;
	}
	
	@RequestMapping("/doNotNeedAuth_schedules.do")
	@ResponseBody
	public List<ScheduleForm> doNotNeedAuth_datagrid(ScheduleForm form){
		return this.scheduleService.schedules(form) ;
	}
	
}
